<?php

class Model_Item_comment {

    protected $comment_id;
    protected $item_id;
    protected $publish_date;
    protected $title;
    protected $author_name;
    protected $author_email;
    protected $body;
    protected $enabled;
    protected $active;
    protected $spam;
    protected $user_id;

    public function __construct(array $options = null) {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    public function __set($name, $value) {
        $method = 'set' . ucfirst($name);
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid content property');
        }
        $this->$method($value);
    }

    public function __get($name) {
        $method = 'get' . ucfirst($name);
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid content property');
        } return $this->$method();
    }

    public function setOptions(array $options) {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
    }

    public function setComment_id($value) {
        $this->comment_id = $value;
    }

    public function getComment_id() {
        return $this->comment_id;
    }

    public function setItem_id($value) {
        $this->item_id = $value;
    }

    public function getItem_id() {
        return $this->item_id;
    }

    public function setPublish_date($value) {
        $this->publish_date = $value;
    }

    public function getPublish_date() {
        return $this->publish_date;
    }

    public function setTitle($value) {
        $this->title = $value;
    }

    public function getTitle() {
        return $this->title;
    }

    public function setAuthor_name($value) {
        $this->author_name = $value;
    }

    public function getAuthor_name() {
        return $this->author_name;
    }

    public function setAuthor_email($value) {
        $this->author_email = $value;
    }

    public function getAuthor_email() {
        return $this->author_email;
    }

    public function setBody($value) {
        $this->body = $value;
    }

    public function getBody() {
        return $this->body;
    }

    public function setEnabled($value) {
        $this->enabled = $value;
    }

    public function getEnabled() {
        return $this->enabled;
    }

    public function setActive($value) {
        $this->active = $value;
    }

    public function getActive() {
        return $this->active;
    }

    public function setSpam($value) {
        $this->spam = $value;
    }

    public function getSpam() {
        return $this->spam;
    }

    public function setUser_id($value) {
        $this->user_id = $value;
    }

    public function getUser_id() {
        return $this->user_id;
    }

    public function toArray() {
        return get_object_vars($this);
    }

}

